home *** CD-ROM | disk | FTP | other *** search
- /*
- * cpx.h - cpx structures
- *
- * Copyright (c) 1991 HiSoft
- * adaptation for GNU C/C++: Volker Hemsen, 10/1997
- *
- * structures: MRETS MOBLK XCPB CPXINFO CPXHEAD
- */
-
- #ifndef CPX_H
- #define CPX_H
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #ifdef __GNUC__
- #define __stdargs
- #define __saveds
- #include <gemfast.h>
- #else
- #include <aes.h>
- #endif
-
- /*
- * for XControl:
- * object tree: 256*176
- * CPXINFO* cpx_init(XCPB* xcpb)
- *
- * Option for COPS:
- * object tree: 512*384 maximum
- * CPXINFO* cpx_init(XCPB *xcpb,long magic,long version);
- */
-
- #ifdef _COPS_
- short is_COPS(long magic,long version)
- {
- #define COPS_MAGIC 0x434F5053
- if ((magic==COPS_MAGIC)&&(version>=0x10000L)) /* COPS? */
- return(1);
- return( 0 ); /* XCONTROL */
- }
- #endif
-
- /******************************************************************/
- /***************** XCPB: XControl parameter block ***************/
- /***************** XControl -> cpx-modul ***************/
- /******************************************************************/
- typedef struct moblk
- {
- short m_out;
- short m_x;
- short m_y;
- short m_w;
- short m_h;
- } MOBLK;
- typedef struct _xcpb
- {
- short handle;
- short booting;
- short version;
- short SkipRshFix;
- char *reserve1;
- char *reserve2;
- void (* __stdargs rsh_fix)(short,short,short,short,OBJECT *,TEDINFO *,
- char *,ICONBLK *,BITBLK *,long *,long *,long *,void *);
- void (* __stdargs rsh_obfix)(OBJECT *,short);
- short (* __stdargs Popup)(char *[],short,short,short,GRECT *, GRECT *);
- void (* __stdargs Sl_size)(OBJECT *,short,short,short,short,short,short);
- void (* __stdargs Sl_x)(OBJECT *,short,short,short,short,short,void (* __saveds)(void));
- void (* __stdargs Sl_y)(OBJECT *,short,short,short,short,short,void (* __saveds)(void));
- void (* __stdargs Sl_arrow)(OBJECT *,short,short,short,short,short,short,short *,short,void (* __saveds)(void));
- void (* __stdargs Sl_dragx)(OBJECT *,short,short,short,short,short *,void (* __saveds)(void));
- void (* __stdargs Sl_dragy)(OBJECT *,short,short,short,short,short *,void (* __saveds)(void));
- short (* __stdargs Xform_do)(OBJECT *,short,short *);
- GRECT *(* __stdargs GetFirstRect)(GRECT *);
- GRECT *(* __stdargs GetNextRext)(void);
- void (* __stdargs Set_Evnt_Mask)(short,MOBLK *,MOBLK *,long);
- #define SAVE_DEFAULTS 0
- #define MEM_ERR 1
- #define FILE_ERR 2
- #define FILE_NOT_FOUND 3
- short (* __stdargs XGen_Alert)(short);
- short (* __stdargs CPX_Save)(void *,long);
- void *(* __stdargs Get_Buffer)(void);
- short (* __stdargs getcookie)(long cookie,long *p_value);
- short Country_Code;
- #define MFSAVE 1
- #define MFRESTORE 0
- void (* __stdargs MFsave)(short saveit,MFORM *mf);
- } XCPB;
-
- /******************************************************************/
- /***************** CPXINFO: cpx-modul -> XControl ***************/
- /******************************************************************/
- typedef struct
- {
- short x;
- short y;
- short buttons;
- short kstate;
- } MRETS;
- typedef struct _cpxinfo
- {
- #ifndef _COPS_
- short (* __saveds __stdargs cpx_call)(GRECT *);
- #else
- short (* __saveds __stdargs cpx_call)(GRECT *, DIALOG *);
- #endif
- void (* __saveds __stdargs cpx_draw)(GRECT *);
- void (* __saveds __stdargs cpx_wmove)(GRECT *);
- void (* __saveds __stdargs cpx_timer)(short *);
- void (* __saveds __stdargs cpx_key)(short,short,short *);
- void (* __saveds __stdargs cpx_button)(MRETS *,short,short *);
- void (* __saveds __stdargs cpx_m1)(MRETS *,short *);
- void (* __saveds __stdargs cpx_m2)(MRETS *mrets,short *);
- short (* __saveds __stdargs cpx_hook)(short,short *,MRETS *,short *,short *);
- void (* __saveds __stdargs cpx_close)(short);
- } CPXINFO;
-
- /******************************************************************/
- /*************************** CPX header ***************************/
- /******************************************************************/
- typedef struct _cpxhead
- {
- #define CPXMAGIC 100 /* magic number */
- unsigned short magic;
- struct
- {
- unsigned reserved : 13;
- unsigned resident : 1; /* RAM resident flag */
- unsigned bootinit : 1; /* boot initialization flag */
- unsigned setonly : 1; /* set only CPX flag */
- } flags;
- long cpx_id; /* CPX ID value */
- unsigned short cpx_version; /* CPX version number */
- char i_text[14]; /* icon text */
- unsigned short sm_icon[48]; /* icon bitmap - 32x24 pixels */
- struct { /* icon colour */
- unsigned ib_maskcolor : 4;
- unsigned ib_datacolor : 4;
- unsigned character : 8;
- } i_color;
- char title_text[18]; /* title for CPX entry */
- struct { /* tedinfo field for colour */
- unsigned te_framecolor : 4;
- unsigned te_textcolor : 4;
- unsigned te_textmode : 1;
- unsigned te_fillpattern : 3;
- unsigned te_interiorcolor : 4;
- } t_color;
- char buffer[64]; /* buffer for RAM storage */
- char reserved[306]; /* reserved for expansion */
- } CPXHEAD;
-
- #ifdef __cplusplus
- }
- #endif
- #endif /* CPX_H */
-